package flexo.file;

public class Property
{
	public String name;
	protected String value;
	
	public Property(String name, String value)
	{
		this.name = name;
		setStringValue(value);
	}
	
	public Property(String name, char value)
	{
		this.name = name;
		setCharValue(value);
	}
	
	public Property(String name, int value)
	{
		this.name = name;
		setIntValue(value);
	}
	
	public Property(String name, float value)
	{
		this.name = name;
		setFloatValue(value);
	}
	
	public Property(String name, boolean value)
	{
		this.name = name;
		setBooleanValue(value);
	}
	
	public String getStringValue()
	{
		return value;
	}
	
	public void setStringValue(String value)
	{
		this.value = value;
	}
	
	public char getCharValue()
	{
		return value.charAt(0);
	}
	
	public void setCharValue(char value)
	{
		this.value = String.valueOf(value);
	}
	
	public int getIntValue()
	{
		return Integer.parseInt(value);
	}
	
	public void setIntValue(int value)
	{
		this.value = String.valueOf(value);
	}
	
	public float getFloatValue()
	{
		return Float.parseFloat(value);
	}
	
	public void setFloatValue(float value)
	{
		this.value = String.valueOf(value);
	}
	
	public boolean getBooleanValue()
	{
		return Boolean.parseBoolean(value);
	}
	
	public void setBooleanValue(boolean value)
	{
		this.value = String.valueOf(value);
	}
	
	public String toString()
	{
		return name + "=" + getStringValue();
	}
}
